﻿@inherits Blazorise.Addon
<CascadingValue Value="@this" IsFixed="true">
    @if ( AddonType == AddonType.Body || NoContainer )
    {
        @ChildContent
    }
    else
    {
        <div id="@ElementId" class="@ClassNames" style="@StyleNames" @attributes="@Attributes">
            @ChildContent
        </div>
    }
</CascadingValue>
@code{
    BaseComponent child;

    internal void Hook( BaseComponent child )
    {
        this.child = child;

        InvokeAsync( StateHasChanged );
    }

    bool NoContainer => child is Frolic.Button || child is Frolic.Dropdown;
}
